function * generatorFibo(){
  let a=0,b=1,c=0;
  console.log("开始执行");
  yield
  while(true){
     yield a;
     c = a+b
     a=b;
     b=c;
  }
}

// 0,1,1,2,3,5,8,13,21,34
gen = generatorFibo()
gen.next();
for (let i=0;i<10;i++) {
    num = gen.next();
    console.log(num)
}


